package com.zqh.app.manager.impl;

import com.zqh.app.dao.UserMapper;
import com.zqh.app.entity.User;
import com.zqh.app.manager.AppUserManager;
import com.zqh.common.entity.Page;
import com.zqh.common.entity.Query;
import com.zqh.common.entity.R;
import com.zqh.common.utils.CommonUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("appUserManager")
public class AppUserManagerImpl implements AppUserManager {

    @Autowired
    UserMapper userMapper;

    @Override
    public List<User> listUser(Page<User> page, Query search) {
        return userMapper.listForPage(page, search);
    }

    @Override
    public R updateUser(Query search) {
        int count = userMapper.update(search);
        return CommonUtils.msg(count);
    }
}
